package com.example.service.serviceImp;

import com.example.common.ResultStatus;
import com.example.dao.CommentMapper;
import com.example.pojo.Comment;
import com.example.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("CommentService")
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;
    @Autowired
    Comment comment;

    //添加评论
    @Override
    public String InsertComment(Comment comment) {
        commentMapper.insert(comment);
        if(comment.equals("")){
           return ResultStatus.ERROR.toString();
        }
        return ResultStatus.SUCCESS.toString();
    }

    //删除评论
    @Override
    public int deleteComment(Integer shareId) {
        commentMapper.deleteById(shareId);
        return 1;
    }

}
